# $Id: PKGBUILD 170207 2012-11-05 11:38:10Z jgc $
# Maintainer: damir <damir@archlinux.org>

pkgbase=libxml++
pkgname=('libxml++' 'libxml++-docs')
pkgver=2.36.0
pkgrel=1
arch=('i686' 'x86_64')
license=('LGPL')
url="http://libxmlplusplus.sourceforge.net/"
makedepends=('pkgconfig' 'glibmm-docs' 'libxml2' 'glibmm')
options=('!libtool' '!emptydirs')
source=(http://ftp.gnome.org/pub/GNOME/sources/${pkgbase}/2.36/${pkgbase}-${pkgver}.tar.xz)
sha256sums=('bfdf327bf9ebd12946b7aa6a152045f209d5c9fecd06ebfcdf9b3e7c1af6e2e1')

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"
  ./configure --prefix=/usr
  make
}

package_libxml++() {
  pkgdesc="C++ bindings to libxml2"
  depends=('libxml2' 'glibmm')
  replaces=('libxml++2')
  provides=("libxml++2=${pkgver}")
  conflicts=('libxml++2')

  cd "${srcdir}/${pkgbase}-${pkgver}"
  sed -i -e 's/install-data-am: install-data-local install-dist_referenceDATA/install-data-am: /' Makefile
  make DESTDIR="${pkgdir}" install
}

package_libxml++-docs() {
  pkgdesc="Developer documentation for libxml++"
  depends=('glibmm-docs')
  cd "${srcdir}/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install-data-local install-dist_referenceDATA
}
